package com.qf.service;

import com.qf.dao.GoodsDao;
import com.qf.dao.GoodsDaoImpl;
import com.qf.pojo.Goods;

import java.util.List;

/**
 * @author 86199
 * @version V1.0
 * @Project jqueryDemo
 * @Package com.qf.service
 * @Description:
 * @Date 2022/5/25 15:39
 */
public class GoodsServiceImpl implements GoodsService {
    @Override
    public void addGoods(Goods goods) {
        GoodsDao goodsDao = new GoodsDaoImpl();
        goodsDao.insertGoods(goods);
    }

    @Override
    public List<Goods> findGoodsAll() {
        GoodsDao goodsDao = new GoodsDaoImpl();
        List<Goods> list = goodsDao.findGoodsAll();
        return list;
    }

    @Override
    public Goods findGoodsById(Integer id) {
        GoodsDao goodsDao = new GoodsDaoImpl();
        Goods goods = goodsDao.findById(id);
        return goods;
    }
}
